<template>
  <div class="app-container">
    <TisTable
      ref="tisTable"
      :columns="column"
      :url="'materialmgtservice/MaterialQuery/GetMaterialPagingList'"
      :tools="tools"
      :list="list"
      :table-option="tOption"
      :sorters="[{ field: 'CreateTime', sortIndex: 1, desc: false }]"
      @handleSelectionChange="handleSelectionChange"
    >
    </TisTable>
  </div>
</template>
<script>
export default {
  name: "Customer",
  data() {
    return {
      column: [
        {
          type: "selection",
        },
        {
          field: "id",
          label: "客户编码",
        },
        {
          field: "name",
          label: "客户名称",
        },
        {
          field: "agent",
          label: "代理商",
        },
        {
          field: "contact",
          label: "联络",
        },
        {
          field: "telephone",
          label: "手机",
        },
        {
          field: "email",
          label: "邮箱",
        },
        {
          field: "address",
          label: "地址",
        },
        {
          field: "legalPerson",
          label: "法人代表",
        },
        {
          field: "memo",
          label: "备注",
        },
        {
          field: "frozenFlag",
          label: "冻结",
          // render: (h, params) => {
          //   // const result = params.row.systemFlag
          //   if (params.row.frozenFlag === 1) {
          //     return <p>是</p>;
          //   } else {
          //     return <p>否</p>;
          //   }
          //   // return h('div', {}, result)
          // },
          filterType: "bool",
        },
        {
          field: "createTime",
          label: "创建时间",
          filterType: "date",
        },
      ],
      list: [{ id: 1 }],
      simpleChoose: false,
      tOption: {
        height: 300,
      },
    };
  },
  methods: {
    handleSelectionChange(val) {
      if (val === 1) {
        this.simpleChoose = true;
      } else {
        this.simpleChoose = false;
      }
    },
  },
};
</script>
